package four.book.biz.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import four.book.biz.DingDanBiz;
import four.book.dao.OrderMapper;
import four.book.entity.Order;
import four.book.entity.User;

/**
@author 鏉庡織
@version 1.0
<p>鏃ユ湡锛�018骞�2鏈�7鏃�涓嬪崍8:09:40</p>
*/
@Service
public class DingDanBizImpl implements DingDanBiz {

	@Resource
	private OrderMapper ordermapper;
	
	public int deleteorder(Integer orderId) {
		int i=ordermapper.deleteByPrimaryKey(orderId);
		return i;
	}

	public int add(Order record) {
		int i=ordermapper.insert(record);
		return i;
	}

	public List<Order> selectorders(User user) {
		List<Order> orders=ordermapper.selectorder(user.getUserId());
		return orders;
	}

	public Order selectorder(Order record) {
		Order order=ordermapper.selectByPrimaryKey(record.getCarId());
		return order;
	}

	public int updateorder(Order record) {
		int i=ordermapper.updateByPrimaryKey(record);
		return i;
	}

}
